package com.ssyt.hiring.web.action;

import java.io.IOException;
import java.util.Date;

import org.apache.struts2.ServletActionContext;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

import com.ssyt.cdp.common.util.DateUtil;
import com.ssyt.hiring.entity.ApplicationEntity;
import com.ssyt.hiring.web.service.ApplicationService;

@Controller
public class ApplicationAction {
	@Autowired
	private ApplicationService applicationService;
	private ApplicationEntity application;
	private int applicationId;
	private int applicationStatus;

	/**
	 * 简历审核
	 */
	public void judgeApplication() {
		String HandleTimeStr = DateUtil.format(new Date());
		applicationService.judgeApplication(applicationId, applicationStatus,
				HandleTimeStr);
		try {
			ServletActionContext.getResponse().getWriter()
					.println(HandleTimeStr);
		} catch (Exception e) {
			e.printStackTrace();
			try {
				ServletActionContext.getResponse().getWriter().print("");
			} catch (IOException e1) {
				e1.printStackTrace();
			}
		}

	}

	public ApplicationEntity getApplication() {
		return application;
	}

	public void setApplication(ApplicationEntity application) {
		this.application = application;
	}

	public int getApplicationId() {
		return applicationId;
	}

	public void setApplicationId(int applicationId) {
		this.applicationId = applicationId;
	}

	public int getApplicationStatus() {
		return applicationStatus;
	}

	public void setApplicationStatus(int applicationStatus) {
		this.applicationStatus = applicationStatus;
	}

	public ApplicationService getApplicationService() {
		return applicationService;
	}

	public void setApplicationService(ApplicationService applicationService) {
		this.applicationService = applicationService;
	}

}
